package com.tech.consumer.controller;

import com.tech.consumer.client.XxxFeignClient;
import com.tech.entity.SystemResult;
import com.tech.entity.user.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.io.Serializable;

@RestController
@RequestMapping("/XXX")
public class XXXFeignController{
    @Autowired
    private XxxFeignClient xxxFeignClient;

    @GetMapping(value = "/{id}/{name}")
    public SystemResult<User> getUserByParam(@PathVariable("id")  Integer id, @PathVariable("name") String name){
        return xxxFeignClient.getUserByParam(id, name);
    }

    @PostMapping("/getUser")
    public SystemResult<User> getUser(User user){
        return xxxFeignClient.getUser(user);
    }
}
